﻿<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<!-- The instances of the ContentBase class will be stored in the "ContentBase" table -->
<class name="NCommet.Core.ContentBase, NCommet.Core" table="ContentBase">
	
  <!-- Identity -->
  <id
    name="id" access="field"
    column="ID" type="Int32" unsaved-value="0">
    <!-- References the Item's ID -->
    <generator class="foreign">
      <param name="property">container</param>
    </generator>
  </id>

  <!-- Column "cb_type": The default discriminator value of subclasses is their class name. -->
  <discriminator
    column="cb_type" type="String" length="50" not-null="true"/>

  <!-- Property "SerializedData" -->
  <property
    name="SerializedData" access="property"
    column="SerializedData" type="String" length="4000" not-null="true" />

  <!-- Field "container": One-to-One association between a ContentBase object and its container Item. -->
  <one-to-one
    name="container" access="field"
    class="NCommet.Core.Item, NCommet.Core" constrained="true"  />
</class>
</hibernate-mapping>
